home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / lib / README.xterm < prev    next >
Encoding:
Text File  |  1996-05-17  |  5.1 KB  |  99 lines

  1.                    Solving of keyboard related problems
  2.                                 with XTERM
  3.                         and GNU Midnight Commander
  4.                        (and other programs as well).
  5.  
  6. Xterm brings a handful of problems with input keys and their translations.
  7. Some of these problems include, that xterm doesn't make any difference
  8. between shifted and not shifted function keys (many keyboards do not have
  9. more than 10 or 12 function keys, so it is useful to generate higher
  10. function keys (11 - 20) by pressing Shift and function key - 10 (e.g. 
  11. Shift+F3 is F13). Xterm also doesn't send Alt+character and Meta+character
  12. as something other than plain character. Also, home key is mostly not
  13. working on most systems. And keypad operator characters (+, -, /, *) send
  14. different sequences (or sometimes do not send anything) than normal +, -, /,
  15. *.
  16.  
  17. Fortunately this can be solved, since xterm is written on top of the 
  18. X Toolkit Intrinsics, which has a built-in feature of event translation
  19. tables that can be specified using X resources. This doesn't apply to rxvt,
  20. where the only solution to this problem would be patching rxvt's sources and
  21. recompiling. So from now one, we are speaking only about xterm (and its
  22. modifications, like color_xterm and ansi_xterm).
  23.  
  24. Xterm brings two new Xt widgets (if you don't know, what it is, it doesn't
  25. matter), vt100 and tek4014 (these are used for displaying of the terminal
  26. in vt100 and tektronic mode). Translation table is specified in
  27. *vt100.translations and *tek4014.translations resources.
  28. You can see a sample in xterm.ad file in this directory. 
  29.  
  30. If you want to install these translations, bear in mind that you have to
  31. keep your terminfo and termcap in sync with these. So if you install
  32. xterm.ad, you have to install xterm.ti and xterm.tcap (or do necessary
  33. changes yourself).
  34.  
  35. xterm.ad has to be loaded into the Xrm (X resource manager), either by xterm
  36. itself or by xrdb utility. There are many places you may want to install it
  37. to, decision is only yours. Preferably it should go to your personal
  38. $HOME/.Xdefaults (if you have any) file. This file is automatically loaded
  39. using xrdb whenever you start the X server (it is done by startx and openwin
  40. scripts). Other possibility is to put this into
  41. $X11ROOT/lib/X11/app-defaults/XTerm or wherever your app-defaults file of
  42. xterm is and whatever is its name (sometimes it will have to be XTerm-ansi,
  43. XTerm-color etc.) Or you can put this anywhere and call 
  44. xrdb xterm.ad
  45. from any script you run on X11 startup.
  46.  
  47. xterm.ti (terminfo database source) you install by running `tic xterm.ti'.
  48. tic will compile it and place it into your TERMINFO directory.
  49.  
  50. xterm.tcap is xterm (and xterm-color) termcap entry. It is based on the
  51. newest termcap database from http://www.ccil.org/~esr/ncurses.html, but
  52. contains a bunch of changes to make all the above mentioned keys to work.
  53. Even if mc is compiled, so that it uses terminfo, you need to install the
  54. termcap entry, so that other programs, which use termcap, will behave
  55. correctly. You have to edit your /etc/termcap and replace xterm and
  56. xterm-color entries by those from xterm.tcap.
  57.  
  58. xterm.ad translation table contains too many items (some of them may be
  59. unnecessary) but are included only to make it work on all different xterms
  60. (xterm terminfo and termcap databases have different sequences for the same
  61. keys in every different database, so xterm.ad works as a stardard to make
  62. xterm.ti and termcap happy). If you find that xterm works well even if you
  63. delete some lines from the translations, feel free to do it.
  64.  
  65. By default are Alt+character keys received by mc generated in xterm.ad
  66. by Alt modifier plus the key. On some systems, you may want to change this
  67. to the Meta modifier (e.g. if the Alt modifier is missing). You do it by
  68. replacing a letters in the beginning of table lines with letter m.
  69.  
  70. And what you might want to know, if you are going to change anything, is:
  71. Each line looks like
  72.     modifiers<Key>keyname: string("something") \n\
  73. where modifiers can be
  74. a for alt
  75. m for meta
  76. c for control
  77. button1 (2, 3) for mouse buttons.
  78.  
  79.   The string is generated whenever the named key is pressed while the
  80. modifiers are in state matching the specification.  Naming a modifier
  81. specifies that the modifier must be pressed.  A ~ in front of a
  82. modifier name specifies that the modifier must NOT be pressed.  If the
  83. set of modifiers is preceded by !, unmentioned modifiers must not be
  84. pressed; otherwise their state is ignored.
  85.  
  86. After <Key> you specify a name of the key (if you don't know a
  87. canonical name of any key, see $X11ROOT/include/X11/keysymdef.h (keyname are
  88. the names there without leading XK_). Then there can be any sequence of
  89. string statements, which send the string to the tty line, as if the user
  90. typed that sequence of characters. If it has the form string(0xXX), where X
  91. are hexadecimal digits, then ascii character of that value is send rather
  92. then sending 0xXX.
  93.  
  94. This is a subset of all the translation table features. If you want a
  95. complete reference, see xterm(1) and X Toolkit Intrinsics manual Appendix B.
  96.  
  97. Please any problems/errors found in this stuff by e-mail to 
  98. mc-devel@roxanne.nuclecu.unam.mx.
  99.